/*     */ package com.jcrj.action.form;
/*     */ 
/*     */ /*     */ import java.io.IOException;
/*     */ import java.util.Date;
/*     */ import java.util.List;

import com.jcrj.action.BaseAction;
/*     */ import com.jcrj.entity.OFlowForm;
/*     */ import com.jcrj.entity.OFlowFormProporty;
/*     */ import com.jcrj.entity.OFormDefinition;
/*     */ import com.jcrj.entity.OUser;
/*     */ import com.jcrj.service.FlowFormService;
/*     */ import com.jcrj.service.SysLogService;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class FlowFormAction extends BaseAction
/*     */ {
/*     */   private List<OFlowForm> formList;
/*     */   private FlowFormService flowFormService;
/*     */   private String formName;
/*     */   private long pageCount;
/*     */   private long totalCount;
/*     */   private String status;
/*     */   private OFlowForm flowForm;
/*     */   private Integer formId;
/*     */   private String[] ids;
/*     */   private List<OFlowFormProporty> proportyList;
/*     */   private String proportyName;
/*     */   private OFlowFormProporty formProporty;
/*     */   private List<OFormDefinition> definitionList;
/*     */   private OFormDefinition definition;
/*     */   private String colspan;
/*     */   private String content;
/*     */   private String wordId;
/*     */   private SysLogService sysLogService;
/*     */ 
/*     */   public String flowFormManager()
/*     */   {
/*  37 */     this.totalCount = this.flowFormService.contFlowForm(this.formName).longValue();
/*  38 */     this.pageCount = ((this.totalCount - 1L) / 10L + 1L);
/*  39 */     if (super.getCurrentPage() > this.pageCount) {
/*  40 */       super.setCurrentPage(Long.valueOf(this.pageCount).intValue());
/*     */     }
/*  42 */     this.formList = this.flowFormService.flowFormList(this.formName, super.getCurrentPage());
/*  43 */     return "success";
/*     */   }
/*     */ 
/*     */   public String saveFlowForm()
/*     */   {
/*     */     try {
/*  49 */       OUser user = (OUser)super.getSession().get("userInfo");
/*  50 */       this.flowForm.setCreateTime(new Date());
/*  51 */       this.flowForm.setUserName(user.getName());
/*  52 */       this.flowForm.setUserId(user.getId());
/*  53 */       this.flowFormService.saveFlowForm(this.flowForm);
/*  54 */       super.getResponse().getWriter().write("success");
/*  55 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/*  57 */       e.printStackTrace();
/*     */       try
/*     */       {
/*  60 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e1) {
/*  62 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/*  60 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e) {
/*  62 */         e.printStackTrace();
/*     */       }
/*     */     }
/*  65 */     return null;
/*     */   }
/*     */   public String form_init() {
/*  68 */     this.formName = this.flowFormService.getTableName();
/*  69 */     return this.status;
/*     */   }
/*     */ 
/*     */   public String getFlowFormById() {
/*  73 */     this.flowForm = this.flowFormService.getFlowFormById(this.formId.intValue());
/*  74 */     return "success";
/*     */   }
/*     */   public String updateFlowForm() {
/*     */     try {
/*  78 */       this.flowFormService.updateFlowForm(this.flowForm);
/*  79 */       super.getResponse().getWriter().write("success");
/*  80 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/*  82 */       e.printStackTrace();
/*     */       try
/*     */       {
/*  85 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e1) {
/*  87 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/*  85 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e) {
/*  87 */         e.printStackTrace();
/*     */       }
/*     */     }
/*  90 */     return null;
/*     */   }
/*     */   public String deleteFlowForm() {
/*     */     try {
/*  94 */       this.flowFormService.deleteFlowForm(this.ids);
/*  95 */       super.getResponse().getWriter().write("success");
/*  96 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/*  98 */       e.printStackTrace();
/*     */       try
/*     */       {
/* 101 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e1) {
/* 103 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/* 101 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e) {
/* 103 */         e.printStackTrace();
/*     */       }
/*     */     }
/* 106 */     return null;
/*     */   }
/*     */   public String flowFormProportyManager() {
/* 109 */     this.proportyList = this.flowFormService.flowFormProportyList(this.formId.intValue(), this.proportyName);
/* 110 */     return "success";
/*     */   }
/*     */   public String proporty_init() {
/* 113 */     this.flowForm = this.flowFormService.getFlowFormById(this.formId.intValue());
/* 114 */     this.proportyName = this.flowFormService.getColumnName();
/* 115 */     return "success";
/*     */   }
/*     */ 
/*     */   public String saveFlowFormProporty() {
/*     */     try {
/* 120 */       OUser user = (OUser)super.getSession().get("userInfo");
/* 121 */       this.formProporty.setCreateTime(new Date());
/* 122 */       this.formProporty.setUserName(user.getName());
/* 123 */       this.flowFormService.saveFlowFormProporty(this.formProporty, this.formName);
/* 124 */       super.getResponse().getWriter().write("success");
/* 125 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/* 127 */       e.printStackTrace();
/*     */       try
/*     */       {
/* 130 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e1) {
/* 132 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/* 130 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e) {
/* 132 */         e.printStackTrace();
/*     */       }
/*     */     }
/* 135 */     return null;
/*     */   }
/*     */ 
/*     */   public String getFlowFormProporty() {
/* 139 */     this.formProporty = this.flowFormService.getFlowFormProporty(this.formId.intValue());
/* 140 */     return "success";
/*     */   }
/*     */   public String updateFlowFormProporty() {
/*     */     try {
/* 144 */       this.flowFormService.updateFlowFormProporty(this.formProporty);
/* 145 */       super.getResponse().getWriter().write("success");
/* 146 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/* 148 */       e.printStackTrace();
/*     */       try
/*     */       {
/* 151 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e1) {
/* 153 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/* 151 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e) {
/* 153 */         e.printStackTrace();
/*     */       }
/*     */     }
/* 156 */     return null;
/*     */   }
/*     */   public String deleteFlowFormProporty() {
/*     */     try {
/* 160 */       this.flowFormService.deleteFlowFormProporty(this.ids);
/* 161 */       super.getResponse().getWriter().write("success");
/* 162 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/* 164 */       e.printStackTrace();
/*     */       try
/*     */       {
/* 167 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e1) {
/* 169 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/* 167 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e) {
/* 169 */         e.printStackTrace();
/*     */       }
/*     */     }
/* 172 */     return null;
/*     */   }
/*     */ 
/*     */   public String formDefinitionList() {
/* 176 */     this.totalCount = this.flowFormService.countFormDefinition(this.formName).longValue();
/* 177 */     this.pageCount = ((this.totalCount - 1L) / 10L + 1L);
/* 178 */     if (super.getCurrentPage() > this.pageCount) {
/* 179 */       super.setCurrentPage(Long.valueOf(this.pageCount).intValue());
/*     */     }
/* 181 */     this.definitionList = this.flowFormService.formDefinitionList(this.formName, super.getCurrentPage());
/* 182 */     return "success";
/*     */   }
/*     */ 
/*     */   public String formDefinition_init() {
/* 186 */     this.formList = this.flowFormService.flowFormList();
/* 187 */     return "success";
/*     */   }
/*     */ 
/*     */   public String showFormStyle() {
/*     */     try {
/* 192 */       super.getResponse().setCharacterEncoding("UTF-8");
/* 193 */       String html = this.flowFormService.getFormStyle(Integer.parseInt(this.colspan), this.formId.intValue());
/* 194 */       super.getResponse().getWriter().write(html);
/* 195 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/* 197 */       e.printStackTrace();
/*     */       try
/*     */       {
/* 200 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e1) {
/* 202 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/* 200 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e) {
/* 202 */         e.printStackTrace();
/*     */       }
/*     */     }
/* 205 */     return null;
/*     */   }
/*     */ 
/*     */   public String saveFormDefinition() {
/*     */     try {
/* 210 */       OUser user = (OUser)super.getSession().get("userInfo");
/* 211 */       this.definition.setUserName(user.getName());
/* 212 */       this.definition.setCreateTime(new Date());
/* 213 */       this.definition.setContent(this.content);
/* 214 */       this.definition.setUserId(user.getId());
/* 215 */       this.flowFormService.saveFormDefinition(this.definition);
/* 216 */       this.sysLogService.saveLog("自定义平台", user.getName(), "添加了" + this.definition.getName() + "表单信息");
/* 217 */       super.getResponse().getWriter().write("success");
/* 218 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/* 220 */       e.printStackTrace();
/*     */       try
/*     */       {
/* 223 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e1) {
/* 225 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/* 223 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e) {
/* 225 */         e.printStackTrace();
/*     */       }
/*     */     }
/* 228 */     return null;
/*     */   }
/*     */   public String getFormDefinition() {
/* 231 */     this.formList = this.flowFormService.flowFormList();
/* 232 */     this.definition = this.flowFormService.getFormDefinition(this.formId.intValue());
/* 233 */     return "success";
/*     */   }
/*     */   public String updateFormDefinition() {
/*     */     try {
/* 237 */       OUser user = (OUser)super.getSession().get("userInfo");
/* 238 */       this.definition.setContent(this.content);
/* 239 */       this.flowFormService.updateFormDefinition(this.definition);
/* 240 */       this.sysLogService.saveLog("自定义平台", user.getName(), "修改了" + this.definition.getName() + "表单信息");
/* 241 */       super.getResponse().getWriter().write("success");
/* 242 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/* 244 */       e.printStackTrace();
/*     */       try
/*     */       {
/* 247 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e1) {
/* 249 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/* 247 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e) {
/* 249 */         e.printStackTrace();
/*     */       }
/*     */     }
/* 252 */     return null;
/*     */   }
/*     */ 
/*     */   public String deleteFormDefinition() {
/*     */     try {
/* 257 */       this.flowFormService.deleteFormDefinition(this.ids);
/* 258 */       super.getResponse().getWriter().write("success");
/* 259 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/* 261 */       e.printStackTrace();
/*     */       try
/*     */       {
/* 264 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e1) {
/* 266 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/* 264 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e) {
/* 266 */         e.printStackTrace();
/*     */       }
/*     */     }
/* 269 */     return null;
/*     */   }
/*     */   public String wordEditor() {
/* 272 */     return "success";
/*     */   }
/*     */ 
/*     */   public List<OFlowForm> getFormList() {
/* 276 */     return this.formList;
/*     */   }
/*     */   public void setFormList(List<OFlowForm> formList) {
/* 279 */     this.formList = formList;
/*     */   }
/*     */   public FlowFormService getFlowFormService() {
/* 282 */     return this.flowFormService;
/*     */   }
/*     */   public void setFlowFormService(FlowFormService flowFormService) {
/* 285 */     this.flowFormService = flowFormService;
/*     */   }
/*     */   public String getFormName() {
/* 288 */     return this.formName;
/*     */   }
/*     */   public void setFormName(String formName) {
/* 291 */     this.formName = formName;
/*     */   }
/*     */   public long getPageCount() {
/* 294 */     return this.pageCount;
/*     */   }
/*     */   public void setPageCount(long pageCount) {
/* 297 */     this.pageCount = pageCount;
/*     */   }
/*     */   public long getTotalCount() {
/* 300 */     return this.totalCount;
/*     */   }
/*     */   public void setTotalCount(long totalCount) {
/* 303 */     this.totalCount = totalCount;
/*     */   }
/*     */ 
/*     */   public String getStatus() {
/* 307 */     return this.status;
/*     */   }
/*     */ 
/*     */   public void setStatus(String status) {
/* 311 */     this.status = status;
/*     */   }
/*     */ 
/*     */   public OFlowForm getFlowForm() {
/* 315 */     return this.flowForm;
/*     */   }
/*     */ 
/*     */   public void setFlowForm(OFlowForm flowForm) {
/* 319 */     this.flowForm = flowForm;
/*     */   }
/*     */ 
/*     */   public Integer getFormId() {
/* 323 */     return this.formId;
/*     */   }
/*     */ 
/*     */   public void setFormId(Integer formId) {
/* 327 */     this.formId = formId;
/*     */   }
/*     */   public String[] getIds() {
/* 330 */     return this.ids;
/*     */   }
/*     */   public void setIds(String[] ids) {
/* 333 */     this.ids = ids;
/*     */   }
/*     */ 
/*     */   public List<OFlowFormProporty> getProportyList() {
/* 337 */     return this.proportyList;
/*     */   }
/*     */ 
/*     */   public void setProportyList(List<OFlowFormProporty> proportyList) {
/* 341 */     this.proportyList = proportyList;
/*     */   }
/*     */   public String getProportyName() {
/* 344 */     return this.proportyName;
/*     */   }
/*     */   public void setProportyName(String proportyName) {
/* 347 */     this.proportyName = proportyName;
/*     */   }
/*     */ 
/*     */   public OFlowFormProporty getFormProporty() {
/* 351 */     return this.formProporty;
/*     */   }
/*     */ 
/*     */   public void setFormProporty(OFlowFormProporty formProporty) {
/* 355 */     this.formProporty = formProporty;
/*     */   }
/*     */ 
/*     */   public List<OFormDefinition> getDefinitionList() {
/* 359 */     return this.definitionList;
/*     */   }
/*     */   public void setDefinitionList(List<OFormDefinition> definitionList) {
/* 362 */     this.definitionList = definitionList;
/*     */   }
/*     */   public OFormDefinition getDefinition() {
/* 365 */     return this.definition;
/*     */   }
/*     */   public void setDefinition(OFormDefinition definition) {
/* 368 */     this.definition = definition;
/*     */   }
/*     */ 
/*     */   public String getColspan() {
/* 372 */     return this.colspan;
/*     */   }
/*     */ 
/*     */   public void setColspan(String colspan) {
/* 376 */     this.colspan = colspan;
/*     */   }
/*     */ 
/*     */   public String getContent() {
/* 380 */     return this.content;
/*     */   }
/*     */   public void setContent(String content) {
/* 383 */     this.content = content;
/*     */   }
/*     */ 
/*     */   public String getWordId() {
/* 387 */     return this.wordId;
/*     */   }
/*     */ 
/*     */   public void setWordId(String wordId) {
/* 391 */     this.wordId = wordId;
/*     */   }
/*     */ 
/*     */   public SysLogService getSysLogService() {
/* 395 */     return this.sysLogService;
/*     */   }
/*     */   public void setSysLogService(SysLogService sysLogService) {
/* 398 */     this.sysLogService = sysLogService;
/*     */   }
/*     */ }